<script setup lang="ts">
import {computed, inject, ref, watch} from "vue";
import {Message} from "@arco-design/web-vue";
import MaInfo from "@/components/ma-info/index.vue"
import dictHelp from "@/utils/dicthelp.js";

const config = inject('config')
const record = ref({})
const visible = ref(false)
const onShow = async (data) => {
  record.value = data
  visible.value = true
}
const infoColumns = ref([
        {
            title: "提单号",
            dataIndex: "number",
        },
        {
            title: "公开提单号",
            dataIndex: "public_number",
        },
        {
            title: "柜号",
            dataIndex: "container_no",
        },
        {
            title: "铅封号",
            dataIndex: "seal_no",
        },
        {
            title: "类型",
            dataIndex: "type",
            formType: "radio",
            dict: {name: 'flrstLegType', translation: true,},
        },
        {
            title: "船期/航班",
            dataIndex: "shipping_schedule_id",
            formType: "select",
            dict: dictHelp.shipping_schedule,
        },
        {
            title: "供应商服务",
            dataIndex: "supplier_service_id",
            formType: "select",
            virtualListProps:{},
            dict: dictHelp.supplier_service,
        },
        {
            title: "出发地",
            dataIndex: "departure",
            formType: "select",
            dict: dictHelp.place,
        },
        {
            title: "目的地",
            dataIndex: "destination",
            formType: "select",
            addDisplay: false,
            dict: dictHelp.place,
        },
        {
            title: "出发时间",
            dataIndex: "departure_at",
            formType: "date",
            showTime: true
        },
        {
            title: "财务",
            dataIndex: "finance_id",
            formType: "select",
            dict: dictHelp.user,
        },
        {
            title: "集装箱规格",
            dataIndex: "container_type",
            dict: {name: 'containerType', translation: true,},
            formType: "select",
        },
    ])
defineExpose({onShow})
</script>
<template>
    <a-drawer title="#提单详情" v-model:visible="visible" width="100%" v-if="visible" unmount-on-close :footer="false">
        <a-space direction="vertical" class="w-full">
            <ma-info :columns="infoColumns" :column="1" layout="horizontal" :data="record"  size="small" :bordered="false"  />
        </a-space>
    </a-drawer>
</template>

<style scoped>

</style>